//
//  CPChartsController.swift
//  CJPackDemo
//
//  Created by 陈警卫 on 2023-12-07.
//

import UIKit
import CJPack

class CPChartsController: CJBaseBackController {
    
    override func viewDidLoad() {
        super.viewDidLoad()

        let chartsView = CJChartsView(frame: CGRect(x: 20, y: 100, width: view.cj_width - 40, height: view.cj_width - 40))
        view.addSubview(chartsView)

        /**
         
         let axis = CJCharts.AxisConfig()
         axis.xAxisCountForCell = 6
         axis.xPointInterval = 10.0
         
         axis.yAxisMaxValue = 226
         axis.yAxisMinValue = 100
         axis.yAxisCount = 10
         //axis.yAxisColor = .clear
         //axis.yAxisDashPattern = []
         axis.yAxisDashColor = .cj_color("929292", alpha: 0.4)
         
         axis.xAxisStyle = .time
         chartsView.axisConfig = axis
         
         let line1 = CJCharts.LineConfig()
         line1.style = .bar
         line1.lineColor = .cj_color("D22007")
         line1.fillColors = [.cj_color("D22007"), .cj_color("D22295")]
         
         chartsView.lineConfigs = [line1]
         
         chartsView.setupConfig()
         
         let timer = Timer.scheduledTimer(withTimeInterval: 0.1, repeats: true) { timer in
         chartsView.setupValue(points: [Double(arc4random_uniform(50) + 150)])
         }
         RunLoop.current.add(timer, forMode: .common)
         */
    }
    


}
